#pragma once

//Encapsulate random number generator
class PRandom
{                  
public:
	PRandom();
	PRandom(int seed)//Constructor
	{
		init(seed);
	}
	//~PRandom();
	void init(int seed);//Initialization
	int range(int min,int max);//Get integer random number in desired interval
	inline double operator()()//Get floating point random number
	{
		//returns a random number between 0 and 1:
		return (double)uint()*(1./(65536.*65536.));
	}
	unsigned int uint();//Output random bits
	double gauss();
	//unsigned int test();
protected:
   unsigned int x[5];//History buffer
};
